import java.util.Arrays;

public class PetDog {
    public String name;
    public String color;

    //狗的属性
    public void barks(){
        System.out.println(name+":汪汪汪~~~");
    }

    //狗的行为
    public void wag(){
        System.out.println(name+":摇尾巴~~~");
    }

    public static void main(String[] args) {
        PetDog dog = new PetDog();
        dog.name = "旺财";
        dog.color = "白色";
        dog.barks();
        dog.wag();

        PetDog dog2 = new PetDog();
        dog2.name = "大黄";
        dog2.color = "黑色";
        dog2.barks();
        dog2.wag();

        PetDog dog3 = new PetDog();
        dog3.name = "小黄";
        dog3.color = "黄色";

        PetDog dog4 = new PetDog();
        dog4.name = "小花";
        dog4.color = "粉色";

        PetDog dog5 = new PetDog();
        dog5.name = "小黑";
        dog5.color = "黑色";

        PetDog dog6 = new PetDog();
        dog6.name = "黑豹";
        dog6.color = "金色";

        PetDog dog7 = new PetDog();
        dog7.name = "黑虎";
        dog7.color = "棕色";
        System.out.println(Arrays.toString(new PetDog[]{dog,dog2,dog3,dog4,dog5,
        dog6,dog7}));
    }
    @Override
    public String toString(){
        return "name:"+name+",color:"+color;
    }
}
